<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;

class AttendanceShift extends Model
{
    use HasFactory;

    protected $fillable = [
        'name',
        'company_id',
        'in_time',
        'out_time',
        'in_flexible_minutes',
        'out_flexible_minutes',
        'late_threshold',
        'early_leave_threshold',
        'is_default',
        'description',

    ];
    const POSTONLY = [
        'name',
        'company_id',
        'in_time',
        'out_time',
        'in_flexible_minutes',
        'out_flexible_minutes',
        'late_threshold',
        'early_leave_threshold',
        'is_default',
        'description',
    ];

    protected function serializeDate(\DateTimeInterface $date)
    {
        return $date->format($this->dateFormat ?: 'Y-m-d H:i:s');
    }
}
